/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ReporteVPJInternalFrame.java
 *
 * Created on 05-31-2010, 08:56:31 PM
 */

package jepi.ui;

import db.MySQLManager;
import java.util.HashMap;
import java.util.Map;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JRViewer;

/**
 *
 * @author Steve
 */
public class ReporteProyectoJInternalFrame extends javax.swing.JInternalFrame {
JasperPrint jPrint;
    /** Creates new form ReporteVPJInternalFrame */
    public ReporteProyectoJInternalFrame(int proyecto) {
        initComponents();
        try {
            Map map = new HashMap();
            map.put("proyecto", proyecto);
            jPrint = JasperFillManager.fillReport(this.getClass().getClassLoader().getResourceAsStream("jepi/reportes/proyecto.jasper"), map, MySQLManager.getConexionEstatica());
            //JasperCompileManager.compileReport("reportes/valorPresente.jrxml");
            //jPrint = JasperFillManager.fillReport("reportes/valorPresente.jasper", map, MySQLManager.getConexionEstatica());
            JRViewer jv = new JRViewer(jPrint);
            this.setSize(750, 400);
            this.getContentPane().add(jv);
        } catch (JRException ex) {
            System.out.println(ex);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Reporte de Proyecto");

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
